import Cookies from "js-cookie";

const TokenKey = "Admin-Token";

export function getToken() {
  const cookie = Cookies.get(TokenKey);
  const localS = localStorage.getItem(TokenKey);
  return cookie || localS;
}

export function setToken(token) {
  Cookies.set(TokenKey, token);
  localStorage.setItem(TokenKey, token);
}

export function removeToken() {
  Cookies.remove(TokenKey);
  localStorage.removeItem(TokenKey);
}
